const Router = require('koa-router');
const router = new Router();
const tool = require('../../tools/tool')
const {db, QueryTypes} = require("../../models/db");
const {detectStock} = require("../bill/base");

router.post('/print/detectStock', async ctx => {
    let user  = ctx.user
    let body  = ctx.request.body
    let ids = body.ids;
    let transType = body.transType;
    let tenantId = user.tenantId;
    return ctx.suc('')
    // 先检测库存
    if(transType === 150601) {
        for (let i = 0; i < ids.length; i++) {
            await detectStock(ids[i].id, 0)
        }
        return ctx.suc('')
    }
    else {
        return ctx.suc('')
    }
})

module.exports = router;
